home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
FROMUTS
/
UNIXLIB37B
/
test
/
c
/
memtest2
< prev
next >
Wrap
Text File
|
1991-06-11
|
941b
|
39 lines
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main()
{
char *a,*b,*c;
int l;
a = "The fat cat jumped over the lazy dog in front of the fireplace";
l = strlen(a);
b = malloc(l);
c = " ";
b[l] = 0;
memcpy(b,a,l); puts(b);
memcpy(b + 1,a,l - 1); puts(b);
memcpy(b,a + 1,l - 1); puts(b);
memcpy(b + 1,a + 1,l - 1); puts(b);
memcpy(b + 2,a,l - 2); puts(b);
memcpy(b,a + 2,l - 2); puts(b);
memcpy(b + 2,a + 2,l - 2); puts(b);
memcpy(b + 3,a,l - 3); puts(b);
memcpy(b,a + 3,l - 3); puts(b);
memcpy(b + 3,a + 3,l - 3); puts(b);
strcpy(b,a);
memcpy(c,b,l); puts(c);
memcpy(c + 1,b,l - 1); puts(c);
memcpy(c,b + 1,l - 1); puts(c);
memcpy(c + 1,b + 1,l - 1); puts(c);
memcpy(c + 2,b,l - 2); puts(c);
memcpy(c,b + 2,l - 2); puts(c);
memcpy(c + 2,b + 2,l - 2); puts(c);
memcpy(c + 3,b,l - 3); puts(c);
memcpy(c,b + 3,l - 3); puts(c);
memcpy(c + 3,b + 3,l - 3); puts(c);
}